#include<stdio.h>
int seq_search(int array[], int n, int k, int seek_seq[]) {
	for (int i = 0; i < n; i++) {
		if (array[i] == k) {
			seek_seq[i] = i;
			return 0;
		}
		else
		{
			seek_seq[i] = i;
		}			
	}
	return -1;
}

int bin_search(int array[], int n, int k, int seek_seq[]) {
	int top = 0;
	int rear = n - 1;
	int i = 0;
	
	while (top <= rear) {
		int middle = (top + rear) / 2;
		if (k > array[middle]) {
			top = middle + 1;
			seek_seq[i] = middle;
		}
		else if (k < array[middle]) {
			rear = middle - 1;
			seek_seq[i] = middle;
		}
		else {
			seek_seq[i] = middle;
			return 0;
		}
		i++;
	}
	return -1;
	
}
